home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Freeware / Gobby 0.4.7 / gobby-0.4.7.exe / {app} / share / gtksourceview-2.0 / language-specs / boo.lang < prev    next >
Extensible Markup Language  |  2008-09-09  |  8KB  |  257 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.  
  4.  Author: Sebastian Dr├╢ge <slomo@circular-chaos.org>
  5.  Copyright (C) 2006 Sebastian Dr├╢ge <slomo@circular-chaos.org>
  6.  
  7.  This library is free software; you can redistribute it and/or
  8.  modify it under the terms of the GNU Library General Public
  9.  License as published by the Free Software Foundation; either
  10.  version 2 of the License, or (at your option) any later version.
  11.  
  12.  This library is distributed in the hope that it will be useful,
  13.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  Library General Public License for more details.
  16.  
  17.  You should have received a copy of the GNU Library General Public
  18.  License along with this library; if not, write to the
  19.  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  20.  Boston, MA 02111-1307, USA.
  21.  
  22. -->
  23. <language id="boo" _name="Boo" version="2.0" _section="Sources">
  24.   <metadata>
  25.     <property name="mimetypes">text/x-boo</property>
  26.     <property name="globs">*.boo</property>
  27.     <property name="line-comment-start">#</property>
  28.     <property name="block-comment-start">/*</property>
  29.     <property name="block-comment-end">*/</property>
  30.   </metadata>
  31.  
  32.   <styles>
  33.     <style id="comment" _name="Comment" map-to="def:comment"/>
  34.     <style id="multiline-string" _name="Multiline string" map-to="def:string"/>
  35.     <style id="string" _name="String" map-to="def:string"/>
  36.     <style id="regex" _name="Regular Expression" map-to="def:string"/>
  37.     <style id="namespace" _name="Namespace" map-to="def:preprocessor"/>
  38.     <style id="type" _name="Data Type" map-to="def:type"/>
  39.     <style id="definition" _name="Definition" map-to="def:keyword"/>
  40.     <style id="keyword" _name="Keyword" map-to="def:keyword"/>
  41.     <style id="special-variable"     _name="Special Variable"      map-to="def:identifier"/>
  42.     <style id="null-value" _name="Null Value" map-to="def:special-constant"/>
  43.     <style id="boolean" _name="Boolean" map-to="def:boolean"/>
  44.     <style id="number" _name="Number" map-to="def:number"/>
  45.     <style id="builtin" _name="Builtin Function" map-to="def:builtin"/>
  46.   </styles>
  47.  
  48.   <definitions>
  49.  
  50.     <context id="c-style-line-comment" style-ref="comment" end-at-line-end="true">
  51.       <start>//</start>
  52.       <include>
  53.         <context ref="def:in-line-comment"/>
  54.       </include>
  55.     </context>
  56.  
  57.     <context id="block-comment" style-ref="comment">
  58.       <start>/\*</start>
  59.       <end>\*/</end>
  60.       <include>
  61.         <context ref="def:in-comment"/>
  62.       </include>
  63.     </context>
  64.  
  65.     <context id="multiline-string" style-ref="multiline-string">
  66.       <start>"""</start>
  67.       <end>"""</end>
  68.       <include>
  69.         <context ref="def:escape"/>
  70.       </include>
  71.     </context>
  72.  
  73.     <context id="double-quoted-string" style-ref="string" end-at-line-end="true">
  74.       <start>"</start>
  75.       <end>"</end>
  76.       <include>
  77.         <context ref="def:escape"/>
  78.         <context ref="def:line-continue"/>
  79.       </include>
  80.     </context>
  81.  
  82.     <context id="single-quoted-string" style-ref="string" end-at-line-end="true">
  83.       <start>'</start>
  84.       <end>'</end>
  85.       <include>
  86.         <context ref="def:escape"/>
  87.         <context ref="def:line-continue"/>
  88.       </include>
  89.     </context>
  90.  
  91.     <context id="regex" style-ref="regex" end-at-line-end="true">
  92.       <start>/(?!/)</start>
  93.       <end>/</end>
  94.     </context>
  95.  
  96.     <context id="namespace" style-ref="namespace">
  97.       <keyword>as</keyword>
  98.       <keyword>from</keyword>
  99.       <keyword>import</keyword>
  100.       <keyword>namespace</keyword>
  101.     </context>
  102.  
  103.     <context id="primitives" style-ref="type">
  104.       <keyword>bool</keyword>
  105.       <keyword>byte</keyword>
  106.       <keyword>char</keyword>
  107.       <keyword>date</keyword>
  108.       <keyword>decimal</keyword>
  109.       <keyword>double</keyword>
  110.       <keyword>duck</keyword>
  111.       <keyword>float</keyword>
  112.       <keyword>int</keyword>
  113.       <keyword>long</keyword>
  114.       <keyword>object</keyword>
  115.       <keyword>operator</keyword>
  116.       <keyword>regex</keyword>
  117.       <keyword>sbyte</keyword>
  118.       <keyword>short</keyword>
  119.       <keyword>single</keyword>
  120.       <keyword>string</keyword>
  121.       <keyword>timespan</keyword>
  122.       <keyword>uint</keyword>
  123.       <keyword>ulong</keyword>
  124.       <keyword>ushort</keyword>
  125.     </context>
  126.  
  127.     <context id="definitions" style-ref="definition">
  128.       <keyword>abstract</keyword>
  129.       <keyword>callable</keyword>
  130.       <keyword>class</keyword>
  131.       <keyword>constructor</keyword>
  132.       <keyword>def</keyword>
  133.       <keyword>destructor</keyword>
  134.       <keyword>do</keyword>
  135.       <keyword>enum</keyword>
  136.       <keyword>event</keyword>
  137.       <keyword>final</keyword>
  138.       <keyword>get</keyword>
  139.       <keyword>interface</keyword>
  140.       <keyword>internal</keyword>
  141.       <keyword>of</keyword>
  142.       <keyword>override</keyword>
  143.       <keyword>partial</keyword>
  144.       <keyword>private</keyword>
  145.       <keyword>protected</keyword>
  146.       <keyword>public</keyword>
  147.       <keyword>return</keyword>
  148.       <keyword>set</keyword>
  149.       <keyword>static</keyword>
  150.       <keyword>struct</keyword>
  151.       <keyword>transient</keyword>
  152.       <keyword>virtual</keyword>
  153.       <keyword>yield</keyword>
  154.     </context>
  155.  
  156.     <context id="keywords" style-ref="keyword">
  157.       <keyword>and</keyword>
  158.       <keyword>break</keyword>
  159.       <keyword>cast</keyword>
  160.       <keyword>continue</keyword>
  161.       <keyword>elif</keyword>
  162.       <keyword>else</keyword>
  163.       <keyword>ensure</keyword>
  164.       <keyword>except</keyword>
  165.       <keyword>for</keyword>
  166.       <keyword>given</keyword>
  167.       <keyword>goto</keyword>
  168.       <keyword>if</keyword>
  169.       <keyword>in</keyword>
  170.       <keyword>isa</keyword>
  171.       <keyword>is</keyword>
  172.       <keyword>not</keyword>
  173.       <keyword>or</keyword>
  174.       <keyword>otherwise</keyword>
  175.       <keyword>pass</keyword>
  176.       <keyword>raise</keyword>
  177.       <keyword>ref</keyword>
  178.       <keyword>try</keyword>
  179.       <keyword>unless</keyword>
  180.       <keyword>when</keyword>
  181.       <keyword>while</keyword>
  182.     </context>
  183.  
  184.     <context id="special-variables" style-ref="special-variable">
  185.       <keyword>self</keyword>
  186.       <keyword>super</keyword>
  187.     </context>
  188.  
  189.     <context id="null-value" style-ref="null-value">
  190.       <keyword>null</keyword>
  191.     </context>
  192.  
  193.     <context id="boolean" style-ref="boolean">
  194.       <keyword>false</keyword>
  195.       <keyword>true</keyword>
  196.     </context>
  197.  
  198.     <context id="numbers" style-ref="number">
  199.       <match extended="true">
  200.         (?<![\w\.])
  201.         [0-9][0-9\.]*(m|ms|d|h|s|f|F|l|L)?
  202.         (?![\w\.])
  203.       </match>
  204.     </context>
  205.  
  206.     <context id="builtins" style-ref="builtin">
  207.       <keyword>array</keyword>
  208.       <keyword>assert</keyword>
  209.       <keyword>checked</keyword>
  210.       <keyword>enumerate</keyword>
  211.       <keyword>__eval__</keyword>
  212.       <keyword>filter</keyword>
  213.       <keyword>getter</keyword>
  214.       <keyword>len</keyword>
  215.       <keyword>lock</keyword>
  216.       <keyword>map</keyword>
  217.       <keyword>matrix</keyword>
  218.       <keyword>max</keyword>
  219.       <keyword>min</keyword>
  220.       <keyword>normalArrayIndexing</keyword>
  221.       <keyword>print</keyword>
  222.       <keyword>property</keyword>
  223.       <keyword>range</keyword>
  224.       <keyword>rawArrayIndexing</keyword>
  225.       <keyword>required</keyword>
  226.       <keyword>__switch__</keyword>
  227.       <keyword>typeof</keyword>
  228.       <keyword>unchecked</keyword>
  229.       <keyword>using</keyword>
  230.       <keyword>yieldAll</keyword>
  231.       <keyword>zip</keyword>
  232.     </context>
  233.  
  234.     <context id="boo">
  235.       <include>
  236.         <context ref="def:shell-like-comment" style-ref="comment"/>
  237.         <context ref="c-style-line-comment"/>
  238.         <context ref="block-comment"/>
  239.         <context ref="multiline-string"/>
  240.         <context ref="double-quoted-string"/>
  241.         <context ref="single-quoted-string"/>
  242.         <context ref="regex"/>
  243.         <context ref="namespace"/>
  244.         <context ref="primitives"/>
  245.         <context ref="definitions"/>
  246.         <context ref="keywords"/>
  247.         <context ref="special-variables"/>
  248.         <context ref="null-value"/>
  249.         <context ref="boolean"/>
  250.         <context ref="numbers"/>
  251.         <context ref="builtins"/>
  252.       </include>
  253.     </context>
  254.  
  255.   </definitions>
  256. </language>
  257.